|
Nginx : PHP-FPM
2016/07/07 |
|
Install PHP-FPM ( PHP FastCGI Process Manager ) to use PHP scripts on Nginx.
|
|
| [1] | Install PHP and PHP-FPM. |
|
root@www:~# apt-get -y install php php-fpm
|
| [2] | Configure PHP-FPM and Nginx. |
|
root@www:~#
vi /etc/nginx/sites-available/default # add follows in "server" section
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
systemctl restart php7.0-fpm nginx |
| [3] | Create a test page to make sure PHP script works normally. |
|
root@www:~# echo "<?php phpinfo() ?>" > /var/www/html/info.php |
|